<template>
  <!-- 能耗计量设备 -->
  <div class="measure noPd">
    <lb-layout
      v-loading="$store.getters.loading"
      element-loading-text="拼命加载中"
      element-loading-spinner="el-icon-loading"
      element-loading-background="#a19f9fb0;"
      :paddBottom="5"
    >
      <measureIndex v-loading="loading" v-if="activeName == '0'"></measureIndex>
      <bagCom
        v-loading="loading"
        v-if="activeName == '1'"
        :activeName="activeName"
      ></bagCom>
    </lb-layout>
  </div>
</template>

<script>
import measureIndex from "@/views/maintenance/operation/maintenance/components/measureC/measureIndex.vue";
import bagCom from "@/views/maintenance/operation/maintenance/components/bagC/bagIndex.vue";
export default {
  components: {
    measureIndex,
    bagCom,
  },
  props: {},
  data() {
    return {
      activeName: "0",
      // tabArr: [
      //   {
      //     label: "首页",
      //     value: "0",
      //   },
      //   {
      //     label: "设备信息包",
      //     value: "1",
      //   },
      //   // {
      //   //   label: "数据包",
      //   //   value: "1",
      //   // },
      //   // {
      //   //   label: "心跳包",
      //   //   value: "2",
      //   // },
      //   // {
      //   //   label: "控制包",
      //   //   value: "3",
      //   // },
      //   // {
      //   //   label: "最新状态",
      //   //   value: "4",
      //   // },
      //   // {
      //   //   label: "控制信息",
      //   //   value: "5",
      //   // },
      //   // {
      //   //   label: "巡检流水",
      //   //   value: "6",
      //   // },
      // ],
      loading: false,
    };
  },
  created() {
    this.routerJudge();
  },
  mounted() {},
  methods: {
    routerJudge() {
      let routeflage = this.$route.path;
      // console.log(routeflage, "routeflage");
      switch (routeflage) {
        case "/maintenance/operation/operation":
          this.activeName = "0";
          break;
        case "/maintenance/operation/bag":
          this.activeName = "1";
          break;
      }
    },
    tabChange() {
      this.loading = true;
      setTimeout(() => {
        this.loading = false;
      }, 500);
    },
  },
};
</script>

<style lang="scss" scoped>
.box {
  padding: 5px 10px;
  background: #fff;
  border-radius: 6px;
}
::v-deep .text-tabs {
  .el-tabs__active-bar {
    width: 79px;
  }
  .el-tabs__item {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.8;
  }
}
.text-tabs {
  margin: 0 0 0 -30px;
}
.measure {
  width: 100%;
  position: relative;
  padding-top: 0;
}
</style>
